{% extends 'base.html' %}
{% block content %}

<ul class="breadcrumb">
  <li><a href="{% url 'list_assets_view' %}">assets</a></li>
  <li class="active">add new asset group manually [<a href="{% url 'list_assets_view' %}">back</a>]</li>
</ul>

<div class="container">
  <form action="{% url 'add_asset_group_view' %}" method="post" class="form-horizontal">
    <legend>Add an asset group</legend>
    {% csrf_token %}
    {% for field in form %}
        {% if field.errors %}
            <div class="form-group has-error">
                <label class="col-sm-2 control-label" for="id_{{ field.name }}">{{ field.label }}</label>
                <div class="col-sm-4">
                    {{ field }}
                    <span class="help-block">
                        {% for error in  field.errors %}{{ error }}{% endfor %}
                    </span>
                </div>
            </div>
        {% elif not field.is_hidden %}
            <div class="form-group">
                <label class="col-sm-2 control-label" for="id_{{ field.name }}">{{ field.label }}</label>
                <div class="col-sm-4">
                    {{ field }}
                    {% if field.help_text %}
                        <p class="help-block"><small>{{ field.help_text }}</small></p>
                    {% endif %}
                </div>
            </div>
        {% endif %}
    {% endfor %}
    <div class="form-group submit-div">
      <div class="col-sm-2">
      </div>
      <div class="col-sm-4">
        <button type="submit" class="btn btn-warning col-sm-12">Create a new asset group</button>
      </div>
    </div>
  </form>
</div>

<div class="notifications">
{% if messages %}
<ul class="messages">
    {% for message in messages %}
    <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
    {% endfor %}
</ul>
{% endif %}
</div>

{% endblock %}
